﻿
<div>
    <div class="title-bold-16">
        Add/Edit alert
    </div>
    Company Name: <b>{{alertCompany.companyName}}</b><br /><br />
    <div style="display: table; width: 99%;">
        <div class="table-row-inp">
            <div class="inp-label">
                Publication Date
            </div>
            <div class="inp-holder">
                <input name="alertPublicationDate" type="text" class="inp" 
                       datepicker-popup="MM/dd/yyyy" 
                       ng-model="alertCompany.currentAlert.publicationDate" ng-required="true" />
            </div>
        </div>
        <div class="table-spacer">&nbsp;</div>
        <div class="table-row-inp">
            <div class="inp-label">
                Title
            </div>
            <div class="inp-holder">
                <input name="alertTitle" type="text" class="inp" ng-model="alertCompany.currentAlert.title" required>
            </div>
        </div>
        <div class="table-spacer">&nbsp;</div>
        <div class="table-row-inp">
            <span>{{alertCompany.currentAlert.fileName}}</span>
            <input type="file" id="alertFile" ng-file-select="alertCompany.onSelectPdf($files, alertCompany.currentAlert);" accept=".pdf" /><br />
            <span class="ui-state-error-text" id="pdfProfile"></span>

            <!-- hidden element for validation -->
            <input name="alertFile" type="text" ng-required="true" ng-model="alertCompany.currentAlert.fileUrl" hidden />
            <!--<input class="btn-green" type="button" value="Upload" ng-click="alertCompany.uploadAlertFile();">-->
        </div>
        <div class="table-spacer">&nbsp;</div>
    </div><br />
    <button class="btn-green" ng-click="alertCompany.saveAlert(alertCompany.currentAlert)" ng-disabled="alertCompany.isSaveDisabled">Save Changes</button>
    <button class="btn-green" ng-click="alertCompany.cancel()">Cancel</button> 
</div>
